read from driver
Type
command
Summary
Takes incoming data from a device that has been opened with the open driver command, and places the data in the it variable.
Syntax
read from driver <deviceName> [at <start>] {until {<string> | end | EOF | empty} | for <amount> [<chunkType>]} [in <time>]
Description
Use the read from driver command to get data from a peripheral device such as a modem.
The until string form reads data until the specified string is encountered. The until empty, until end, and until EOF forms read data until there is no more data to be read.
Parameters
Name | Type | Description |
---|---|---|
deviceName | The name of a device driver that's installed on the system and that you have previously opened with the open driver command. | |
start | The start specifies the character or byte position in the device's input where you want to begin reading. | |
string | string | When LiveCode encounters the string in the data coming in from the device, it stops reading. If the string is not encountered, the read from driver command continues reading as long as there is data to be read. |
amount | A positive integer and specifies how much data to read. | |
chunkType | One of chars, characters, words, items, lines, int1, uInt1, int2, uint2, int4, or uint4. The read from driver command reads amount of the specified chunkType. If you don't specify a chunkType, amount characters are read. | |
time | The time to wait for the read to be completed, in milliseconds, seconds, or ticks. |
Examples
read from driver ".BIn" for 3 lines
read from driver it for 2 chars in 2 seconds
Related
command: open driver, write to driver, read from process
control structure: function
function: result
glossary: binary file, variable, command, peripheral device
keyword: it
Compatibility and Support
Introduced
LiveCode 1.1.1
OS
mac
windows
linux
Platforms
desktop
server